<div>
  <form class="form-horizontal" role="form" novalidate name="myForm">
    <div class="form-ctrl md-whiteframe-z1">
      <div class="form-search" style="height:280px;" ng-class="{true: 'shou'}[shoumun.num==0]" ng-switch
           on="sendData.timeType">
        <div>
          <label style="width:70px">对象</label>
          <md-select ng-model="sendData.provinceObj" >
            <md-option ng-value="po.provinceObjCode" ng-repeat="po in provinceObj">{{po.provinceObjName}}</md-option>
          </md-select>
        </div>
        <div>
          <label style="width:70px">省份</label>
          <md-select multiple ng-model="sendData.province">
            <md-select-label>
              {{sendData.province.length ? _getNames(sendData.province,'provinceName',provinces) :'全部'}}
            </md-select-label>
            <md-option ng-value="" ng-click="_checkAll(sendData,'province')">全部</md-option>
            <md-option ng-value="p" ng-repeat="p in provinces">{{p.provinceName}}</md-option>
          </md-select>
        </div>
        <div>
          <label style="">时间粒度</label>
          <md-select ng-model="sendData.timeType" >
            <md-option ng-value="item.timeTypeCode" ng-repeat="item in timeTypes" ng-click="getTimeTypeCode(item.timeTypeCode,sendData)">{{item.timeTypeName}}</md-option>
          </md-select>
        </div>
        <div ng-switch-when="5">
          <md-input-container flex>
            <label>开始时间</label>
            <input type="number" ng-model="sendData.startTime"  time-validate="year" end-time="sendData.endTime"  required name="startYear">
            <div ng-messages="myForm.startYear.$error">
              <div ng-message="date">请正确输入时间</div>
              <div ng-message="time-error">开始时间不应大于结束时间</div>
              <div ng-message="too-great">结束时间不应大于当前时间</div>
            </div>
          </md-input-container>
        </div>
        <div ng-switch-when="5">
          <md-input-container flex>
            <label>结束时间</label>
            <input type="number" ng-model="sendData.endTime"  time-validate="year" start-time="sendData.startTime" required name="endYear">
            <div ng-messages="myForm.endYear.$error">
              <div ng-message="date">请正确输入时间</div>
              <div ng-message="time-error">开始时间不应大于结束时间</div>
              <div ng-message="too-great">结束时间不应大于当前时间</div>
            </div>
          </md-input-container>
        </div>
        <div ng-switch-when="3">
          <md-input-container flex>
            <label>开始时间</label>
            <input type="month" ng-model="sendData.startTime"  time-validate="month" end-time="sendData.endTime" required
                   name="startMonth">
            <div ng-messages="myForm.startMonth.$error">
              <div ng-message="date">请正确输入时间</div>
              <div ng-message="time-error">开始时间不应大于结束时间</div>
              <div ng-message="too-great">结束时间不应大于当前时间</div>
            </div>
          </md-input-container>
        </div>
        <div ng-switch-when="3">
          <md-input-container flex>
            <label>结束时间</label>
            <input type="month" ng-model="sendData.endTime"  time-validate="month" start-time="sendData.startTime"
                   required name="endMonth">
            <div ng-messages="myForm.endMonth.$error">
              <div ng-message="date">请正确输入时间</div>
              <div ng-message="time-error">开始时间不应大于结束时间</div>
              <div ng-message="too-great">结束时间不应大于当前时间</div>
            </div>
          </md-input-container>
        </div>
      </div> <i class="glyphicon glyphicon-chevron-up shrinkage" ng-show="!btnDisabled" ng-click="shoumun.num=0"></i>
      <md-button ng-disabled="myForm.$invalid"  ng-click="shoumun.num==1?shoumun.num=0:shoumun.num=1;search()" class="md-fab md-primary md-hue-1" aria-label="Profile"> <i class="glyphicon glyphicon-arrow-down"
      style="margin-top:28px;"  ng-show="shoumun.num==0"></i>
        <i class="glyphicon glyphicon-search" ng-show="shoumun.num==1"></i>
      </md-button>
    </div>
  </form>
  <div class="table-info">
    <div class="menus" ng-show="flag === 'table' || flag === 'view'">
      <form ng-show="flag !== 'tableDown'" action="{{formPrefix}}" target="_black" method="post" style="display: initial;">
        <input type="hidden" name="data" value="{{outData}}">
        <md-button type="submit" class="md-raised">导出Excel</md-button>
      </form>
      <md-button class="md-raised" ng-click="showView()" style="background-color: #FF9800;color:white">图表</md-button>
      <md-button class="md-raised" ng-click="showTable()" style="background-color: #FF9800;color:white">总表</md-button>
    </div>
    <div class="menus" ng-show="flag === 'tableDown'">
      <md-button class="md-raised" ng-click="back()">返回</md-button>
    </div>
    <div ng-show="flag === 'view'">
      <div id="doc" style="height:450px;padding: 15px;"></div>
    </div>
    <div ng-show="flag === 'table'">
      <div class="table-detail" >
        <div class="t_r" style="overflow-x: scroll;">
          <table class="table table-bordered" style="min-width: 100%;max-width: none;table-layout: fixed;word-break:break-all;">
            <caption style="text-align:center;font-weight:bold;"> <font color="black">{{title}}</font>
            </caption>
            <thead>
              <tr>
                <th width="80px;" rowspan="2">省份/考核</th>
                <th width="290px;" ng-repeat="time in times">{{time}}</th>
              </tr>
              <tr>
                <th width="210px;" ng-repeat="time in times" class="diffcount-td">
                  <div style="width:30%;">总交易业务数</div>
                  <div style="width:30%;">成功交易业务数</div>
                  <div style="width:20%;">成功率</div>
                  <div style="width:20%;">得分</div>
                </th>
              </tr>
            </thead>
            <tbody>
              <tr ng-repeat="item in items">
                <td width="80px;">{{item.prov}}</td>
                <td width="210px;" ng-repeat="lineData in item.detail" ng-click="tableDown(item)"  class="diffcount-td">
                  <div style="width:30%;">{{lineData.total}}</div>
                  <div style="width:30%;">{{lineData.successTotal}}</div>
                  <div style="width:20%;">{{lineData.successRate}}%</div>
                  <div style="width:20%;">{{lineData.score}}</div>
                </td>
              </tr>
            </tbody>
          </table>
        </div>
      </div>
    </div>
    <div ng-show="flag === 'tableDown'">
      <div class="table-detail" >
        <div class="t_r">
          <table class="table table-bordered" style="min-width: 100%;max-width: none;table-layout: fixed;word-break:break-all;">
            <caption style="text-align:center;font-weight:bold;"> <font color="black">{{title}}</font>
            </caption>
            <thead>
              <tr>
                <th>时间</th>
                <th>成功交易业务数</th>
                <th>成功率</th>
                <th>得分</th>
              </tr>
            </thead>
            <tbody>
              <tr ng-repeat="dd in downData">
                <td>{{dd.time}}</td>
                <td>{{dd.successTotal}}</td>
                <td>{{dd.successRate}}%</td>
                <td>{{dd.score}}</td>
              </tr>
            </tbody>
          </table>
          <ds-page
              total-count="totalCount"
              page-size="sendDown.page.pageSize"
              page-itmes="pageItmes"
              param="sendDown"
              current-page="sendDown.page.currentPage"
              go-page="callback()"
              page-size-change="pageSizeChange(sendDown.page.pageSize)"
              show-max-page="5"
              first-text="<<"
              last-text=">
             >"
              previous-text="
             <"
              next-text=">
               "
              >
             </ds-page>
        </div>
      </div>
    </div>
  </div>
</div>